<?php
$rows = array(array("仓库:{$outbound['warehouse']}", "单号:{$outbound['sno']}", 
		"出库类型:".BoundHelper::type2txt($outbound['type']).
			(($outbound['type']==Bound::TYPE_LL) ? '('.ReviewerHelper::flow2txt($outbound['audit_flow']).')' :''), 
		"日期:{$outbound['addtime']}"));

$tmp = array('材料编号','材料名称','品牌','规格','单位', '数量', );
if($outbound['type']==Bound::TYPE_LL){
	$tmp[] = '工单号';
	$tmp[] = '用途';
}
else{
	$tmp[] = '备注';
}
$rows[] = $tmp;

if($outbound['items']) foreach($outbound['items'] as $ware){
	$tmp = array($ware['sno'], $ware['name'], $ware['brand'], $ware['specific'], $ware['unit'], $ware['amount']);
	if($outbound['type']==Bound::TYPE_LL){
		$tmp[] = $ware['add_sno'];
	}
	$tmp[]  = $ware['remark'];
	$rows[] = $tmp;
}
Exporter::csv($rows, '出库单');

?>
